/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 殇
 * Date: 2025-05-20
 * Time: 15:36
 */
//冒泡排序
public class code8 {
    public static void bubbleSort(int[] nums){
        int n=nums.length;
        for(int i=0;i<n;i++){
            for(int j=0;j<n-i-1;j++){
                if(nums[j]>nums[j+1]){
                    int tmp=nums[j+1];
                    nums[j+1]=nums[j];
                    nums[j]=tmp;
                }
            }
        }
    }
    public static void main(String[] args) {
        int[] nums=new int[]{7,3,25,34,75,56,12,1,32,17,4,52};
        bubbleSort(nums);
        for(int x:nums){
            System.out.print(x+" ");
        }
    }
}
